/**
 * Created by h16pham on 2/06/14.
 */
function fullProfile()
        {
            var display = $("#full").css("display");
            if (display == 'none')
            $("#full").css("display", "block");
            else
            $("#full").css("display", "none");
            }

window.fbAsyncInit = function() {
    FB.init({
        appId: '1468430386721592',
        status: true,
        xfbml: true
    });
};

(function(d, s, id) {
    var js, fjs = d.getElementsByTagName(s)[0];
    if (d.getElementById(id)) {
        return;
    }
    js = d.createElement(s);
    js.id = id;
    js.src = "//connect.facebook.net/en_US/all.js";
    fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));

    function connectFB()
        {
            FB.login(function(response) {
                if (response.authResponse) {
                    FB.api('/me', function(response) {
                        window.location = "auth.php?fbid="+response.id;
                    });
    } else {
        alert('User cancelled login or did not fully authorize.');
        }
    });
    }
    //                FB.Event.subscribe('auth.authResponseChange', function(response) {
        //                        if (response.status === 'connected') {
        //                            FB.api('/me', function(response) {
        //                                window.location = "http://ltuprj.qv.vic.edu.au/~Cerberus/chat/index.php?user=" + response.name + "";
        //                            });
    //                            testAPI();
    //                        } else if (response.status === 'not_authorized') {
        //                            FB.login();
        //                        } else {
        //                            FB.login();
        //                        }
    //                    });
    //            }